<template>
	<div v-for='(item,index) in arrList' :key='arrList.index'>
	<p>元素的值：{{item}}------其索引为:{{index}}</p>
	</div>
	<h3>根据对象组渲染列表</h3>
	<div v-for='(item,index) in objList' :key='index'>
	<p>元素的值：{{item}}------其索引为:{{index}}</p>
	</div>
</template>

<script setup>
	import { reactive } from 'vue';
	const arrList=reactive(["橙子","草莓","蓝莓","香蕉"])
	const objList=reactive([
		{id:1,fruitname:'橙子',price:4.98},
		{id:2,fruitname:'草莓',price:4.98},
		{id:3,fruitname:'蓝莓',price:4.98},
		{id:4,fruitname:'香蕉',price:4.98},
	])
</script>

<style>
</style>